module.exports = {
    /**
     * 修改数据
     * @url admin/kong/sys/update 前端调用的url参数地址
     * data 请求参数 说明
     * res 返回参数说明
     * @param {Number} code 错误码，0表示成功
     * @param {String} msg 详细信息
     */
    main: async (event) => {
        let { data = {}, userInfo, util, filterResponse, originalParam } = event;
        let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
        let { uid } = data;
        let res = { code: 0, msg: 'ok' };
        // 业务逻辑开始-----------------------------------------------------------
        let {
            _ids
        } = data;
        if (vk.pubfn.isNullOne(_ids)) {
            return { code: -1, msg: '参数错误' };
        }
        let dbName = "tm-detection-form";
        for (let index = 0; index < _ids.length; index++) {
            const _id = _ids[index];

            let _detectionform=  await vk.baseDao.findById({
                dbName: dbName,
                id: _id
            });
            let _count = 0;
            if (vk.pubfn.isNotNull(_detectionform.printcount)) { 
                _count = _detectionform.printcount;
            }
            _count++;
            await vk.baseDao.updateById({
                dbName,
                id: _id,
                dataJson: {
                    printcount: _count,
                }
            });
         }


   
        // 业务逻辑结束-----------------------------------------------------------
        return res;
    }

}
